<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>违约统计</title>
    <meta name="decorator" content="default"/>
    <script src="${ctxStatic}/lodop/LodopFuncs.js" type="text/javascript"></script>
    <script>
        function search() {
            $("#searchForm").attr("action", "${ctx}/statistics/outLine").submit();
        }

        var LODOP; //声明为全局变量
        function myPreview1(){
            LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));
            var strBodyStyle="<head>"+$("head").html()+"</head>";
            var strFormHtml=strBodyStyle+"<body>"+$("#contentTable").html()+"</body>";
            LODOP.PRINT_INIT("违约统计");

            LODOP.ADD_PRINT_TEXT(50,50,260,39, "日期："+$("#begin").val()+"--"+$("#end").val());

            LODOP.ADD_PRINT_HTM(88, 50, 300, 200, strFormHtml);
            LODOP.PREVIEW();
        }
    </script>
</head>
<body>
<form:form id="searchForm" action="${ctx}/statistics/outLine" method="post" class="breadcrumb form-search">
    <ul class="ul-form">
        <li>
            <label>按照：</label>
            违约类型
            <label style="width: 180px;">进行统计 统计范围从</label>

            <input id="begin"
                   name="begin"
                   class="input-medium Wdate"
                   readonly="readonly"
                   maxlength="20"
                   type="text"
                   value="${begin}"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">
            至
            <input id="end"
                   name="end"
                   class="input-medium Wdate"
                   readonly="readonly"
                   maxlength="20"
                   type="text"
                   value="${end}"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">

        </li>
        <li style="margin-left: 20px;">
            <a href="javascript:search();" class="btn">统计</a>&nbsp;&nbsp;
            <a href="javascript:myPreview1();" class="btn">打印</a>
        </li>
    </ul>

</form:form>
<sys:message content="${message}"/>
<div id="contentTable">
    <table class="table table-striped table-bordered table-condensed" style="width: 600px;">
        <thead>
        <tr>
            <th>读者类型</th>
            <th>违约本数</th>
        </tr>
        </thead>
        <tbody>
            <c:set var="total" value="0"/>
            <c:forEach items="${outLine}" var="item" varStatus="status">
                <tr>
                        <td style="text-align: right;"><c:out value="${item.grad}"/></td>
                    <td style="text-align: right;"><c:out value="${item.count}"/></td>
                    <c:set var="total" value="${total+item.count}"/>
                </tr>
            </c:forEach>
            <tr>
                <td style="text-align: right;">合计</td>
                <td style="text-align: right;">${total}</td>
            </tr>
        </tbody>
    </table>
</div>
<div class="printArea">
    <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=1 height=1>
        <param name="Caption" value="内嵌显示区域">
        <param name="Border" value="1">
        <param name="Color" value="#C0C0C0">
        <embed id="LODOP_EM" TYPE="application/x-print-lodop" width=1 height=1 PLUGINSPAGE="install_lodop.exe">
    </object>
</div>
</body>
</html>